// STPoint2.h
#ifndef __STPOINT2_H__
#define __STPOINT2_H__

#include "stForward.h"
#include "STUtil.h" // for ST_INLINE

#include <math.h>

/**
*  Simple struct to represent 2D points
*/
struct STPoint2
{
    ST_INLINE STPoint2();
    ST_INLINE STPoint2(float x, float y);
    ST_INLINE explicit STPoint2(const STVector2& v);

    ST_INLINE STPoint2& operator+=(const STVector2& right);
    ST_INLINE STPoint2& operator-=(const STVector2& right);

    /**
    * Returns distance between two points
    */
    ST_INLINE float Dist(const STPoint2& left, const STPoint2& right);

    /**
    * Returns distance squared between two points
    */
    ST_INLINE float DistSq(const STPoint2& left, const STPoint2& right);

    float x, y;

    static const STPoint2 Origin;
};

ST_INLINE STPoint2 operator+(const STPoint2& left, const STVector2& right);
ST_INLINE STPoint2 operator+(const STVector2& left, const STPoint2& right);
ST_INLINE STPoint2 operator-(const STPoint2& left, const STVector2& right);

#include "STPoint2.inl"

#endif  // __STPOINT2_H__
